import {
	defineStore
} from 'pinia';

const modal = defineStore('modal', {
	state: () => ({
		auth: '', // 授权弹框 accountLogin
		linkShare: false, // 商品详情分享弹框
		posterShare: false, // 画报分享弹框
		lastTimer: {
			// 短信验证码计时器，为了防止刷新请求做了持久化
			smsLogin: 0,
		},
	}),
	persist: {
		enabled: true,
		strategies: [{
			key: 'modal-store',
			paths: ['lastTimer'],
		}, ],
	},
});

export default modal;